#pragma once

#include <string>
#include <boost/shared_ptr.hpp>

#include "torrent/fwd_decl.hpp"
#include "torrent/bencode_helper.hpp"

namespace torrent {

class TrackerRequest
{
public:
	static std::string param(const Client& c, const std::string& infoHash,
		const std::string& event = "started",
		boost::uint64_t left = 100, boost::uint64_t downloaded = 0, boost::uint64_t uploaded = 0);
};

class TrackerResponse
{
public:
	//typedef std::string String;
	//const String _failReason = "failure reason";
	//const String _warningMessage = "warning message";
	//const String _interval = "interval";
	//const String _minInterval = "min interval";
	//const String _trackerId = "tracker id";
	//const String _complete = "complete";
	//const String _incomplete = "incomplete";

	std::string _host;
	std::string _port;
	std::string _requestPath;

	std::string _httpContent;
	bencode_helper::be_node_ptr _node;
	PeerList _peers;

	TrackerResponse(const std::string& host
		, const std::string& port
		, const std::string& requestPath
		, const std::string& httpContent);

	TrackerResponse(const std::string& host
		, const std::string& port
		, const std::string& requestPath);

	std::string getFailureReason();
};

}
